/** 查询用户个人信息 */
export function getUserProfileApi(): Promise<ApiDataRecord<UserRecord>> {
  return request({
    url: '/system/user/profile',
    method: 'get'
  })
}

/** 修改用户个人信息 */
export function updateUserProfileApi(data: UserRecord): Promise<ApiRecord> {
  return request({
    url: '/system/user/profile',
    method: 'put',
    data: data
  })
}

/** 用户头像上传 */
export function uploadAvatarApi(data: FormData): Promise<ApiRecord> {
  return request({
    url: '/system/user/profile/avatar',
    method: 'post',
    data: data
  })
}

/** 用户密码修改 */
export function updateUserPwdApi(data: { oldPassword: string; newPassword: string }): Promise<ApiRecord> {
  return request({
    url: '/system/user/profile/updatePwd',
    method: 'put',
    params: data
  })
}